<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="yes" name="apple-touch-fullscreen">
    <meta content="telephone=no" name="format-detection">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1;user-scalable=no;">
    <title>1起购</title>
    <link rel="stylesheet" href="/statics/view/css/bootstrap.css">
    <link rel="stylesheet" href="/statics/view/css/style.css">
    <link rel="stylesheet" href="/statics/view/css/order3.css">
    <link rel="stylesheet" href="/statics/view/css/invoice.css">
    <link href="/statics/view/css/yy_pay.css" rel="stylesheet">
    <script charset="utf-8" src="/statics/view/js/jquery.min.js"></script>
    <script charset="utf-8" src="/statics/view/js/global.js"></script>
    <script charset="utf-8" src="/statics/view/js/bootstrap.min.js"></script>
    <script charset="utf-8" src="/statics/view/js/template.js"></script>
</head>
<body>
<div class="fanhui_cou">
    <div class="fanhui_1"></div>
    <div class="fanhui_ding">顶部</div>
</div> <header class="header header_1">
    <div class="fix_nav">
        <div style="max-width:768px;margin:0 auto;background:#db3652;position: relative;">
            <a class="nav-left back-icon" href="javascript:history.back();">返回</a>
            <div class="tit">充值</div>
            <a class="nav-right icon-home" href="/dbs/index.html">首页</a>
        </div>
    </div>
</header>
<div class="common-wrapper receipt">
    <div class="m re-type bdb-1px" style="padding-top: 0px;">
        <div class="mt_new">
            <h2>1.选择充值数量</h2>
        </div>
        <div class="m-pay-moneySelector" id="pro-view-2">
            <div class="m-pay-moneySelector-item m-pay-moneySelector-item-selected" id="pro-view-3" data-amount="20">20购劵</div>
            <div class="m-pay-moneySelector-item" id="pro-view-1" data-amount="50">50购劵</div>
            <div class="m-pay-moneySelector-item" id="pro-view-2" data-amount="100">100购劵</div>
            <div class="m-pay-moneySelector-item" id="pro-view-2" data-amount="200">200购劵</div>
            <div class="m-pay-moneySelector-item" id="pro-view-3"><input type="text" name="amount" placeholder="其他数额" pattern="[0-9]*"></div>
        </div>

        <div class="clr"></div>
    </div>
    <div class="receipt-tab-w">

        <div class="rtw">
            <div class="m re-con border-1px">
                <div class="mt_new bdb-1px" style="border-bottom:1px solid #d7d7d7">
                    <h2>2.选择支付方式</h2>
                </div>
                <div class="mc">
                    <dl class="bdb-1px nobook">
                        <dd class="inv_noBookCheck">

                            <strong class="pic-ch pic-ched" content="WeixinPayPlugin" id="invoince_content2"></strong>
                            <span>微信支付</span>
                        </dd>
                        <dd class="inv_noBookCheck">
                            <strong class="pic-ch " content="AliyunPayPlugin" id="invoince_content1"></strong>
                            <span>支付宝支付</span>
                        </dd>

                    </dl>
                </div>
            </div>
        </div>
    </div>

    <div class="btn-bar border-1px" id="submitDiv">
        <a href="javascript:void(0);" class="bb-btn02" id="payBtn">确定</a>
    </div>
</div>

<div class="clear"></div>

<script type="text/javascript">
    var content;
    $(function(){
        $(".m-pay-moneySelector-item").click(function(){
            $(".m-pay-moneySelector-item").removeClass("m-pay-moneySelector-item-selected");
            $(this).addClass("m-pay-moneySelector-item-selected");
        });
        $(".inv_noBookCheck").click(function(){
             content = $(this).find("strong").attr("content");
            alert(content);
            $("#content").val(content);
            $(this).find("strong").attr("class","pic-ch pic-ched");
            $($(this).siblings()).find("strong").attr("class","pic-ch");
        });
        $("#payBtn").click(function(){
            alert(111);
            var amount=$(".m-pay-moneySelector-item-selected").attr("data-amount");
             content =  $("#content").val();

            if(amount==null){
                var re = /^[0-9]+.?[0-9]*$/;
                amount=$("input[name='amount']").val();
                if (!re.test(amount))
                {
                    alert("请输入数字");
                    $("input[name='amount']").val("");
                }
            }
            alert(content+"%%%%"+amount);
            paySubmit(amount);
        });
        $("input[name='amount']").change(function(){
            var re = /^[0-9]+.?[0-9]*$/;
            var number = $(this).val();
            if (!re.test(number))
            {
                alert("请输入数字");
                $(this).val("");
            }
        });

    });

</script>
</body></html>